<?php

namespace App\Http\Requests\Api;


class UpdateUserRequest extends FormRequest {
    public function rules() {
        $userId = auth('api')->id();
        return [
            'name' => 'required|between:2,200|unique:users,name,'.$userId,
            'introduction'=>'max:200',
            'avatar_image_id'=>'exists:images,id,type,avatar,user_id,'.$userId
        ];
    }
    public function attributes() {
        return [
            'avatar_image_id'=>'用户头像ID'
        ];
    }
}
